home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / system / mail / transpor / ifmail23.z / ifmail23 / ifmail / ifcico / GETTY.diff < prev    next >
Encoding:
Text File  |  1994-02-19  |  4.5 KB  |  199 lines

  1. --- getty_ps/OLD/main.c    Sun Feb 20 00:22:31 1994
  2. +++ getty_ps/main.c    Mon Jan 24 01:20:38 1994
  3. @@ -124,6 +124,7 @@
  4.  
  5.  #ifdef FIDO
  6.      fido =        (char *) NULL;        /* fido program */
  7. +    emsi =        (char *) NULL;        /* emsi yes or no */
  8.  #endif /* FIDO */
  9.  
  10.  #ifdef SCHED
  11. @@ -337,6 +338,7 @@
  12.      if((p = defvalue(def, "INITLINE"))) InitDevice = p;
  13.  #ifdef FIDO
  14.      fido = defvalue(def, "FIDO");
  15. +    emsi = defvalue(def, "EMSI");
  16.  #endif /* FIDO */
  17.  
  18.  #ifdef SCHED
  19. @@ -526,8 +528,13 @@
  20.  
  21.  /* now, the init device is opened ONLY if INIT or WAITCHAR is requested
  22.  */
  23. +/* This is a bad idea. Because any previous programs could leave the tty
  24. +   in unpredictable stty state (the worst is CLOCAL left ON), we would
  25. +   better comment out the following "if" to run the initialization pass
  26. +   on every invocation, regarless of the presence of "init" or "waitchar" 
  27.  
  28.      if((init) || (waitchar)) {
  29. +*/
  30.          debug3(D_RUN, "opening init line: %s\n", initdevname);
  31.          while((fd = open(initdevname, O_RDWR | O_NDELAY)) < 0) {
  32.              if(errno == EBUSY)
  33. @@ -554,6 +561,7 @@
  34.          setbuf(stdout, (char *) NULL);
  35.          setbuf(stderr, (char *) NULL);
  36.  
  37. +        settermio(&(gtab->itermio), INITIAL);
  38.  
  39.          flags = fcntl(STDIN, F_GETFL, 0);
  40.          (void) fcntl(STDIN, F_SETFL, flags & ~O_NDELAY);
  41. @@ -578,7 +586,9 @@
  42.  
  43.              settermio(&(gtab->itermio), INITIAL);
  44.          }
  45. +/*
  46.      }
  47. +*/
  48.  
  49.  /* set the alarm if requested
  50.  */
  51. @@ -619,11 +629,17 @@
  52.          }
  53.      }
  54.  
  55. +/* Again, as we opened the line anyway, here we must close it regardless
  56. +   of the "init" and "waitchar"
  57. +
  58.      if((init) || (waitchar)) {
  59. +*/
  60.          (void) close(0);
  61.          (void) close(1);
  62.          (void) close(2);
  63. +/*
  64.      }
  65. +*/
  66.  }
  67.  
  68.  
  69. @@ -862,8 +878,12 @@
  70.  #endif /* ISSUE */
  71.  
  72.  login_prompt:
  73. -        (void) Fputs(gtab->login, stdout);
  74.          (void) ioctl(STDIN, TCFLSH, 0);
  75. +#ifdef FIDO
  76. +    if (emsi && (strcmp(emsi,"yes") == 0)) 
  77. +        (void) Fputs("**EMSI_REQA77E\r", stdout);
  78. +#endif
  79. +        (void) Fputs(gtab->login, stdout);
  80.          if(TimeOut > 0) {
  81.              (void) signal(SIGALRM, timeout);
  82.              (void) alarm((unsigned) TimeOut);
  83. --- getty_ps/OLD/main.h    Mon Apr 12 00:22:13 1993
  84. +++ getty_ps/main.h    Thu Oct 28 22:54:57 1993
  85. @@ -108,6 +108,7 @@
  86.  
  87.  #ifdef FIDO
  88.  EXTERN char        *fido;        /* fido program */
  89. +EXTERN char        *emsi;        /* fido program */
  90.  #endif /* FIDO */
  91.  
  92.  #ifdef SCHED
  93. --- getty_ps/OLD/funcs.c    Sun Apr 18 00:28:04 1993
  94. +++ getty_ps/funcs.c    Sat Feb 19 02:55:44 1994
  95. @@ -66,6 +66,9 @@
  96.  /* SMR - gcc uses signed characters, so I cast the following */
  97.  #define    AUTOBD    ((char)0376)    /* marker for AutoBaud digits */
  98.  
  99. +extern char *fido;
  100. +extern char *emsi;
  101. +
  102.  char    *unquote();
  103.  int    expect(), send();
  104.  boolean    expmatch();
  105. @@ -662,6 +665,8 @@
  106.      register int count;
  107.      register int lower = 0;
  108.      register int upper = 0;
  109. +    int tsynccount=0;
  110. +    int yoohoocount=0;
  111.      char ch, *p;
  112.      ulong lflag;
  113.  
  114. @@ -697,7 +702,8 @@
  115.      do {
  116.          if (read(STDIN, &ch, 1) != 1)    /* nobody home */
  117.              exit(0);
  118. -        if ((ch = (char) ((int) ch & 0177)) == CEOF)
  119. +        /* if ((ch = (char) ((int) ch & 0177)) == CEOF) */
  120. +        if (ch == CEOF)
  121.              if (p == name)        /* ctrl-d was first char */
  122.                  exit(0);
  123.          if (ch == CQUIT)        /* user wanted out, i guess */
  124. @@ -706,14 +712,18 @@
  125.              debug2(D_GETL, "returned (BADSPEED)\n");
  126.              return(BADSPEED);
  127.          }
  128. -        if (ch == TSYNC) {
  129. -            name = "tsync";
  130. +#ifdef FIDO
  131. +        if (fido && (ch == TSYNC))
  132. +        if (tsynccount++ > 1) {
  133. +            strcpy(name,"tsync");
  134.              return (FIDOCALL);
  135.          }
  136. -        if (ch == YOOHOO) {
  137. -            name = "yoohoo";
  138. +        if (fido && (ch == YOOHOO))
  139. +        if (yoohoocount++ > 1) {
  140. +            strcpy(name,"yoohoo");
  141.              return (FIDOCALL);
  142.          }
  143. +#endif
  144.          if (!(lflag & ECHO)) {
  145.              (void) putc(ch, stdout);
  146.              (void) fflush(stdout);
  147. @@ -734,7 +744,13 @@
  148.              }
  149.              p = name;
  150.              count = 0;
  151. -        } else {
  152. +#ifdef FIDO
  153. +        } else if (((unsigned)ch >= ' ') &&
  154. +               (ch != TSYNC) &&
  155. +               (ch != YOOHOO)) {
  156. +#else
  157. +        } else if ((unsigned)ch >= ' ') {
  158. +#endif
  159.              *p++ = ch;
  160.              count++;
  161.              if (islower(ch))
  162. @@ -744,7 +760,7 @@
  163.          }
  164.      } while ((ch != '\n') && (ch != '\r') && (count < size));
  165.  
  166. -    *(--p) = '\0';    /* terminate buffer */
  167. +    *(p) = '\0';    /* terminate buffer */
  168.  
  169.      if (ch == '\r') {
  170.          (void) putc('\n', stdout);
  171. @@ -756,10 +772,26 @@
  172.          (void) fflush(stdout);
  173.      }
  174.  
  175. -    if (strlen(name) == 0) {
  176. +    if (strlen(name) == strspn(name," ")) {
  177.          debug2(D_GETL, "returned (NONAME)\n");
  178.          return(NONAME);
  179.      }
  180. +
  181. +#ifdef FIDO
  182. +    for (p=name;(*p) && (*p == '*');p++);
  183. +    if ((strncmp(p,"EMSI_",5) == 0) ||
  184. +        (strncmp(p,"emsi_",5) == 0))
  185. +    if (emsi && (strcmp(emsi,"yes") == 0))
  186. +    {
  187. +        debug2(D_GETL, "returned EMSI call\n");
  188. +        return(FIDOCALL);
  189. +    }
  190. +    else
  191. +    {
  192. +        debug2(D_GETL, "EMSI call,return (NONAME)\n");
  193. +        return(NONAME);
  194. +    }
  195. +#endif
  196.  
  197.      if (upper && !lower) {
  198.  #ifdef    WARNCASE
  199.